﻿<Window x:Class="TfsTasksList.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:TfsTasksList"
        Title="MainWindow" Height="478" Width="1212" Icon="/TfsTasksList;component/server_lightning.png">
    <Window.Resources>
        <local:LinksFormatter x:Key="LinksFormatter" />
        <local:WorkitemConverter x:Key="WorkItemFormatter" />
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="5">
            <StackPanel  Grid.Row="0" Width="200" Margin="5"  >
                <TextBlock Text="ServerName:" />
                <TextBox Name="txtServerUrl"  Text="http://srvtfs:8080/tfs/ispc dev"/>
                <TextBlock Text="ProjectName:"  />
                <ComboBox Name="cmbProjects" IsEnabled="False" DisplayMemberPath="Name"/>

                <StackPanel Orientation="Horizontal">
                    <Button Name="btnConnect" Margin="2" Content="Connect" Width="80" Click="btnConnect_Click" />
                </StackPanel>
            </StackPanel>
            <StackPanel Width="200" Margin="5" >
                <TextBlock Text="Authenticated user"  />
                <TextBlock Name="txtAuthUser"  Text=""  />
                <TextBlock Text="Display name"  />
                <TextBlock Name="txtDisplayName" Text=""/>

            </StackPanel>
            <StackPanel Width="200" Margin="5" >
                <TextBlock Text="Field definitions"  />
                <ComboBox Name="cmbFields" IsEnabled="False" DisplayMemberPath="Name" SelectionChanged="cmbFields_SelectionChanged" />
                <TextBox Name="txtelement"/>
                <DatePicker Name="dtDateFrom" />
                <Button Name="btnRetrieveTasks" Content="Get tasks" Width="80" Click="btnRetrieveTasks_Click" HorizontalAlignment="Right" />
            </StackPanel>
            <StackPanel Width="500" Margin="5" >
                <TextBlock Text="Field definitions"  />
                <TextBox Name="txtQuery" Height="100" Text="SELECT * FROM WorkItems 
where [System.CreatedDate] >= '2011-11-01' 
ORDER BY [System.WorkItemType], [System.Id]" MinLines="30" AcceptsReturn="True" />
                <Button Content="Execute custom query" Name="btnCustomQuery" Width="138" Click="btnCustomQuery_Click" />
            </StackPanel>
        </StackPanel>
        <DataGrid AutoGenerateColumns="False" Name="grdtasks" Grid.Row="2">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Id" Binding="{Binding Id}" />
                <DataGridTextColumn Header="Title" Binding="{Binding Title}" />
                <DataGridTextColumn Header="Created Date" Binding="{Binding CreatedDate}" />
                <DataGridTextColumn Header="Created By" Binding="{Binding CreatedBy}" />
                <DataGridTextColumn Header="Assigned to" Binding="{Binding Assignedto}" />
                <DataGridTextColumn Header="Changed Date" Binding="{Binding ChangedDate}" />
                <DataGridTextColumn Header="Changed By" Binding="{Binding ChangedBy}" />
                <DataGridTextColumn Header="State" Binding="{Binding State}" />
                <DataGridTextColumn Header="History" Binding="{Binding History}" />
                
                
                <!--<DataGridTextColumn Header="Description" Binding="{Binding Description}" />-->
                <!--<DataGridTextColumn Header="History" Binding="{Binding History}" />
                <DataGridTextColumn Header="ChangedBy" Binding="{Binding ChangedBy}" />
                <DataGridTextColumn Header="RevisedDate" Binding="{Binding RevisedDate}" />
                <DataGridTextColumn Header="ChangedDate" Binding="{Binding ChangedDate}" />
                <DataGridTextColumn Header="CreateDate" Binding="{Binding CreateDate}" />
                <DataGridTextColumn Header="CreatedBy" Binding="{Binding CreatedBy}" />-->
                <!--<DataGridTextColumn Header="DisplayForm" Binding="{Binding DisplayForm}" />-->
                

                
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Window>
